<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h2>{{person.name}}--{{person.age}}</h2>
        <h3>{{person.fav}}</h3>
        <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
        </ul>
        <h3>{{msg}}</h3>
        <div v-text="msg"></div>
        <div v-text="person.name"></div>
        <div v-html="htmlStr"></div>
        <input type="text" v-model="msg">
        <p></p>
        <button v-on:click="handleClick">v-on形式按钮</button>
        <button @click="handleClick">@形式按钮</button>
        <p></p>
        <a v-bind:href="srcStr">v-bind形式属性绑定</a>
        <p></p>
        <a v-bind:href="srcStr">：形式属性绑定</a>
    </div>
    <script src="./Observer.js"></script>
    <script src="./Myvue.js"></script>
    <script>
        let vm = new Myvue({
            el:'#app',
            data:{
                person:{
                    name:'一羊迁徙',
                    age:24,
                    fav:'敲代码'
                },
                msg:'vue.js中MVVM的实现原理，v-text是通过textContent实现的',
                htmlStr:'<h2>v-html是通过innerHTML实现的</h2>',
                srcStr:'https://www.baidu.com/'
            },
            methods:{
                handleClick(){
                    console.log('按钮被点击了')
                    this.$data.person.name="哈哈哈哈哈"
                    this.srcStr = 'https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty'
                }
            }
        })
    </script>
</body>
</html>